<template>
  <view class="detail-base-info">
    <view class="section">
      <view class="section-title">
        <text class="icon" />
        <text class="text">
          基本信息
        </text>
      </view>
      <view class="section-body">
        <template v-for="item in baseInfo">
          <base-info-item
            :key="item.fieldId"
            :field="item"
            :detail-data="detailData" />
        </template>
      </view>
    </view>

    <!-- <template v-if="false">
      <view
        v-for="(child, index) in insertFields"
        :key="index"
        class="section">
        <view class="section-title">
          <text class="icon" />
          <text class="text">
            {{ child.name }}
          </text>
        </view>
        <view class="section-body">
          <base-info-item
            v-for="item in child.list"
            :key="item.fieldId"
            :field="item"
            :detail-data="detailData" />
        </view>
      </view>
    </template> -->
  </view>
</template>

<script>
  // import { InformationById as LeadsInformation } from 'API/crm/leads'
  // import { InformationById as CustomerInformation } from 'API/crm/customer'
  // import { InformationById as ContactsInformation } from 'API/crm/concat'
  // import { InformationById as BusinessInformation } from 'API/crm/business'
  // import { InformationById as ContractInformation } from 'API/crm/contract'
  // import { InformationById as ReceivablesInformation } from 'API/crm/received'
  // import { InformationById as ProductInformation } from 'API/crm/product'
  // import { InformationById as InvoiceInformation } from 'API/crm/invoice'

  import BaseInfoItem from './baseInfoItem'
  import {srmXjOrderById} from 'API/inqueryMessage'

  export default {
    name: 'DetailBaseInfo',
    components: {
      BaseInfoItem
    },
    props: {
      detailId: {
        type: [String, Number],
        required: true
      },
      detailData: {
        type: Object,
        default: () => {}
      },
      type: {
        type: String,
        required: true
      },
      insertFields: {
        type: Array,
        default: null
      }
    },
    data() {
      return {

        dialogMsg: '',
        webUrl: '',

        // reqMap: {
        //   crm_leads: LeadsInformation,
        //   crm_customer: CustomerInformation,
        //   crm_pool: CustomerInformation,
        //   crm_contacts: ContactsInformation,
        //   crm_business: BusinessInformation,
        //   crm_contract: ContractInformation,
        //   crm_receivables: ReceivablesInformation,
        //   crm_product: ProductInformation,
        //   crm_invoice: InvoiceInformation
        // },

        showBaseInfo: true
      }
    },
    computed: {
      baseInfo() {
        console.log('baseInfo', this.insertFields)
        return this.insertFields
      }
    },
    wkActivated() {
      this.showBaseInfo = false
      this.$nextTick(function() {
        this.showBaseInfo = true
      })
    },
    mounted() {
    },
    methods: {
      /**
       * 获取自定义字段信息
       */
    }
  }
</script>

<style scoped lang="scss">
.detail-base-info {
  .section {
    width: 100%;
    background-color: white;
    padding: 32rpx 0 20rpx;
    margin-bottom: 15rpx;
    &:first-child {
      border-radius: 18rpx 18rpx 0 0;
    }
    .section-title {
      padding: 0 25rpx;
      .icon {
        width: 15rpx;
        height: 15rpx;
        vertical-align: middle;
        background-color: #333333;
        border-radius: 50%;
        display: inline-block;
        margin-right: 15rpx;
      }
      .text {
        color: #212121;
        font-size: 28rpx;
      }
    }
    .section-body {

    }
  }
}
</style>
